<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<style>
img{

    width: 213px !important;
    height: 101px !important;
    border-radius: 0 !important;

}
</style>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.addFull()" shiro:hasPermission="wechat:wechatIndexPic:add">
					<i class="fa fa-plus"></i> 添加
				</a>
				<a class="btn btn-primary btn-edit disabled" onclick="$.operate.editFull()" shiro:hasPermission="wechat:wechatIndexPic:edit">
					<i class="fa fa-edit"></i> 修改
				</a>
				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="wechat:wechatIndexPic:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="wechat:wechatIndexPic:export">
						<i class="fa fa-download"></i> 导出
				 </a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('wechat:wechatIndexPic:edit')}]];
        var removeFlag = [[${@permission.hasPermi('wechat:wechatIndexPic:remove')}]];
        var prefix = ctx + "wechat/wechatIndexPic";
        var wechat_index_pic_type = [[${@dict.getType('wechat_index_pic_type')}]];
        var wechat_index_pic_status = [[${@dict.getType('wechat_index_pic_status')}]];
        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "首页宣传图片",
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : '序号',
					visible: false
				},
				{
					field : 'linkUrl', 
					title : '图片',
					sortable: true,
				    formatter: function(value, row, index) {
				        return "<a href='"+row.linkUrl+"' target='_Blank'>"+$.table.imageView(value, "")+"</a>";
				    }
				},
				{
					field : 'title', 
					title : '标题',
					sortable: true
				},
				{
					field : 'subTitle', 
					title : '子标题',
					sortable: true
				},
				{
					field : 'linkType', 
					title : '链接类型',
					sortable: true,
		            formatter: function(value, row, index) {
		            	return $.table.selectDictLabel(wechat_index_pic_type, row.linkType);
		            }
				},
				
				{
					field : 'status', 
					title : ' 图片状态',
					sortable: true,
		            formatter: function(value, row, index) {
		            	return $.table.selectDictLabel(wechat_index_pic_status, row.status);
		            }
				},
				{
					field : 'pos', 
					title : '排序',
					sortable: true
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.editFull(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>